package cn.yunzhisheng.vui.assistant.oem;

import android.content.Context;
import android.content.Intent;
import android.util.Log;

public class RomCustomSetting {
	public static final String TAG = "RomCustomSetting";
	private static final boolean flag = false;
	
	private static final String ORDER_PREV = "android.intent.action.";
	
	private static final String OPEN_BLUETOOTH = ORDER_PREV + "OPEN_BLUETOOTH";
	private static final String OPEN_PHONEBOOK = ORDER_PREV + "BLUETOOTH_PHONEBOOK";
	private static final String OPEN_DIALPAD = ORDER_PREV + "BLUETOOTH_DIALPAD";
	private static final String SYNC_PHONEBOOK = ORDER_PREV + "PHONEBOOK_SYNC";
	
	private static final String MUSIC_PLAY = ORDER_PREV + "MUSIC_PLAY";
	private static final String MUSIC_PAUSE = ORDER_PREV + "MUSIC_PAUSE";
	private static final String MUSIC_PREV = ORDER_PREV + "MUSIC_PREV";
	private static final String MUSIC_NEXT = ORDER_PREV + "MUSIC_NEXT";
	
	private static final String DIAL_NUMBER = ORDER_PREV + "BLUETOOTH_DIALNUMBER";
	
	private static Intent mIntent = new Intent();
	
	private RomCustomSetting() {}

	//打开蓝牙功能
	public static void RomCustomOpenBlueTooth(Context context){
		mIntent.setAction(OPEN_BLUETOOTH);
		romCustomLog(TAG,mIntent.toString(),flag);
		context.sendBroadcast(mIntent);
	}
	
	//打开通讯录
	public static void RomCustomOpenPhonebook(Context context){
		mIntent.setAction(OPEN_PHONEBOOK);
		romCustomLog(TAG,mIntent.toString(),flag);
		context.sendBroadcast(mIntent);
	}
	
	//打开拨号界面
	public static void RomCustomOpenDialpad(Context context){
		mIntent.setAction(OPEN_DIALPAD);
		romCustomLog(TAG,mIntent.toString(),flag);
		context.sendBroadcast(mIntent);
	}
	
	//同步通讯录
	public static void RomCustomSyncPhonebook(Context context){
		mIntent.setAction(SYNC_PHONEBOOK);
		romCustomLog(TAG,mIntent.toString(),flag);
		context.sendBroadcast(mIntent);
	}
	
	//播放蓝牙音乐
	public static void RomCustomMusicPlay(Context context){
		mIntent.setAction(MUSIC_PLAY);
		romCustomLog(TAG,mIntent.toString(),flag);
		context.sendBroadcast(mIntent);
	}
	
	//暂停蓝牙音乐
	public static void RomCustomMusicPause(Context context){
		mIntent.setAction(MUSIC_PAUSE);
		romCustomLog(TAG,mIntent.toString(),flag);
		context.sendBroadcast(mIntent);
	}
	
	//上一曲蓝牙音乐
	public static void RomCustomMusicPrev(Context context){
		mIntent.setAction(MUSIC_PREV);
		romCustomLog(TAG,mIntent.toString(),flag);
		context.sendBroadcast(mIntent);
	}
	
	//下一首蓝牙音乐
	public static void RomCustomMusicNext(Context context){
		mIntent.setAction(MUSIC_NEXT);
		romCustomLog(TAG,mIntent.toString(),flag);
		context.sendBroadcast(mIntent);
	}
	
	//打电话
	public static void RomCustomDialNumber(Context context,String number){
		mIntent.setAction(DIAL_NUMBER);
		mIntent.putExtra("num", number);
		romCustomLog(TAG,mIntent.toString(),flag);
		romCustomLog(TAG,"number : "+number,flag);
		context.sendBroadcast(mIntent);
	}
	
	//--------------------------------------------------------------------------------------------------------------
	private static void romCustomLog(String tag, String content, boolean flag){
		if(flag){
			Log.d(TAG, content);
		}
	}
}
